﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using AllInOne;
using AllInOne.Classes;
using AllInOne.Entity;
namespace AllInOne.MainPages
{
    /// <summary>
    /// IndexPage.xaml 的交互逻辑
    /// </summary>
    public partial class IndexMainPage : Page
    {

        private MainWindow parent;

        public IndexMainPage()
        {
            InitializeComponent();
        }

        public IndexMainPage(MainWindow parent)
        {
            InitializeComponent();
            this.parent = parent;

        }

        private void BtnQmhz_MouseUp(object sender, MouseButtonEventArgs e)
        {
            this.parent.ChooseBusiness(BusinessType.QMHZ);
        }

        private void BtnYsbz_MouseUp(object sender, MouseButtonEventArgs e)
        {
            this.parent.ChooseBusiness(BusinessType.YSBZ);
        }

        private void BtnShhz_MouseUp(object sender, MouseButtonEventArgs e)
        {
            this.parent.ChooseBusiness(BusinessType.SHHZ);
        }

        private void BtnCcsl_MouseUp(object sender, MouseButtonEventArgs e)
        {
            //测试自助机
            this.parent.Choose_Business(EnterBusinessType.CeShiFaKaJi);
            this.parent.ShowTestPage();
        }

        private void BtnLnmj_MouseUp(object sender, MouseButtonEventArgs e)
        {
            //this.parent.ShowRczkIndex();
            ////进入还卡页面
            //MessageBox.Show("先刷ic卡");
            //this.parent.Choose_Business(EnterBusinessType.CCHK);
            this.parent.ShowReturnIndex();
        }

        /// <summary>
        /// 入厂制卡---以前的代码
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnJsz_MouseUp(object sender, MouseButtonEventArgs e)
        {
            //展示另外主要菜单
            this.parent.ShowJszIndex();
        }

        private void BtnJdc_MouseUp(object sender, MouseButtonEventArgs e)
        {
            this.parent.ShowJdcIndex();
        }

        //private void btnZzpz_MouseUp(object sender, MouseButtonEventArgs e)
        //{
        //    this.parent.ChooseBusiness(BusinessType.ZZPZ);
        //    //this.parent.TestStartTakePhoto();
        //}


        /// <summary>
        /// 制卡操作Zkcz--点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnZkcz_MouseUp(object sender, MouseButtonEventArgs e)
        {
            this.parent.Choose_Business(EnterBusinessType.ZKCZ);
            this.parent.ShowZkczIndex();
        }
        
        /// <summary>
        /// 还卡
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnCchk_MouseUp(object sender, MouseButtonEventArgs e)
        {
            this.parent.ShowText("还卡相关操作");
            this.parent.Choose_Business(EnterBusinessType.CCHK);
        }
        /// <summary>
        /// 数据查询
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnSjcx_MouseUp(object sender, MouseButtonEventArgs e)
        {
            //this.parent.Choose_Business(EnterBusinessType.SJCX);
            MessageBox.Show("数据查询页面不可用");
        }

        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            if (SystemParam.TestPage == 1)
            {
                btnCcsl.Visibility = Visibility.Visible;
            }
        }
    }
}
